package it.antonio.ilpizze.aop.pointcut;

import it.antonio.ilpizze.aop.Pointcut;
import it.antonio.ilpizze.reflection.MethodAccessor;

public class MethodNamePointcut implements Pointcut{

        private String[] names;
        
        public MethodNamePointcut(String... names) {
                this.names = names;
        }

        public boolean apply(MethodAccessor method) {
                for(String name: names){
                        if(method.getName().equals(name)){
                               return true;
                        }
                }
                return false;
        }

}